package org.example.observerPattern;

public class ObserverPatternDemo {
    public static void main(String[] args) {
        // 创建一个主题
        ConcreteSubject subject = new ConcreteSubject();
        subject.add(new ConcreteObserver());
        subject.add(new ConcreteObserver());
        subject.changeState("java");
        subject.changeState("flink");
    }
}
